/ Assembly List / LJCNetCommon / NetCommon / HasData

Namespace - LJCNetCommon


Parameters
dataTable - The data table object.

Returns

True if the data table contains any rows.

Syntax

C#
public static Boolean HasData(DataTable dataTable)

Checks a data table and returns true if it contains any rows. (E)

Remarks

This allows a single if statement where the DataTable value may be null.

Example

C#
using System.Data;
using LJCNetCommon;
        
private static void HasData()
{
  DataTable dataTable = new DataTable();
    
  // Returns false.
  bool result = NetCommon.HasData(dataTable);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.